package io;

import java.io.FileOutputStream;
import java.io.OutputStream;

public class demo9 {
    public static void main(String[] args) {
        //这里不是覆盖，是清空                       加上true 变成追加
        try(OutputStream outputStream = new FileOutputStream("./text.txt",true)){
            // outputStream.write(97);
            // outputStream.write(98);
            // outputStream.write(99);
            // outputStream.write(100);

            byte[] bytes = {
                (byte) 0xe4,
                (byte) 0xbd,
                (byte) 0xa0,
                (byte) 0xe5,
                (byte) 0xa5,
                (byte) 0xbd,
            };
            outputStream.write(bytes);
        }catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }
}
